home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / syscall / Ioc_WriteBack.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-30  |  1.8 KB  |  60 lines

  1. /* 
  2.  * Ioc_WriteBack.c --
  3.  *
  4.  *    Source code for the Ioc_WriteBack library procedure.
  5.  *
  6.  * Copyright 1988 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15.  
  16. #ifndef lint
  17. static char rcsid[] = "$Header: /sprite/src/lib/c/syscall/RCS/Ioc_WriteBack.c,v 1.1 89/08/30 08:38:10 brent Exp $ SPRITE (Berkeley)";
  18. #endif not lint
  19.  
  20. #include <sprite.h>
  21. #include <fs.h>
  22.  
  23.  
  24. /*
  25.  *----------------------------------------------------------------------
  26.  *
  27.  * Ioc_WriteBack --
  28.  *
  29.  *    Write back cached data for a stream.  The arguments indicate
  30.  *    a byte range that should be written back.  The caller
  31.  *    has the option of blocking until the data is written out,
  32.  *    or the caller can let the write back happen asynchronously.
  33.  *
  34.  * Results:
  35.  *    A return status.
  36.  *
  37.  * Side effects:
  38.  *    Writes out cache data.
  39.  *
  40.  *----------------------------------------------------------------------
  41.  */
  42.  
  43. ReturnStatus
  44. Ioc_WriteBack(streamID, firstByte, lastByte, shouldBlock)
  45.     int streamID;        /* StreamID returned from Fs_Open */
  46.     int firstByte;        /* Index of first byte to write back */
  47.     int lastByte;        /* Index of last byte ot write back */
  48.     Boolean shouldBlock;    /* If TRUE, block until write back is done */
  49. {
  50.     register ReturnStatus status;
  51.     Ioc_WriteBackArgs args;
  52.  
  53.     args.firstByte = firstByte;
  54.     args.lastByte = lastByte;
  55.     args.shouldBlock = shouldBlock;
  56.     status = Fs_IOControl(streamID, IOC_WRITE_BACK, sizeof(Ioc_WriteBackArgs),
  57.             (Address)&args, 0, (Address) 0);
  58.     return(status);
  59. }
  60.